#ifndef _XIN_SHADER_COMMON_H_
#define _XIN_SHADER_COMMON_H_ 1

#include "Defines.xsh"

#define XIN_HLSL 1

#define BUILTIN_REGISTER_SAMPLER_POINT_WRAP 5
#define BUILTIN_REGISTER_SAMPLER_POINT_CLAMP 6
#define BUILTIN_REGISTER_SAMPLER_POINT_BORDER 7

#define BUILTIN_REGISTER_SAMPLER_LINEAR_WRAP 8
#define BUILTIN_REGISTER_SAMPLER_LINEAR_CLAMP 9
#define BUILTIN_REGISTER_SAMPLER_LINEAR_BORDER 10

#define BUILTIN_REGISTER_SAMPLER_TRILINEAR_WRAP 11
#define BUILTIN_REGISTER_SAMPLER_TRILINEAR_CLAMP 12
#define BUILTIN_REGISTER_SAMPLER_TRILINEAR_BORDER 13

#define BUILTIN_REGISTER_SAMPLER_SHADOW 14

#define BUILTIN_REGISTER_IMPL(RegisterIndex) register (s ## RegisterIndex)
#define BUILTIN_REGISTER(RegisterIndex) BUILTIN_REGISTER_IMPL(RegisterIndex)

SamplerState PointWrapSampler : BUILTIN_REGISTER(BUILTIN_REGISTER_SAMPLER_POINT_WRAP);
SamplerState PointClampSampler : BUILTIN_REGISTER(BUILTIN_REGISTER_SAMPLER_POINT_CLAMP);
SamplerState PointBorderSampler : BUILTIN_REGISTER(BUILTIN_REGISTER_SAMPLER_POINT_BORDER);

SamplerState LinearWrapSampler : BUILTIN_REGISTER(BUILTIN_REGISTER_SAMPLER_LINEAR_WRAP);
SamplerState LinearClampSampler : BUILTIN_REGISTER(BUILTIN_REGISTER_SAMPLER_LINEAR_CLAMP);
SamplerState LinearBorderSampler : BUILTIN_REGISTER(BUILTIN_REGISTER_SAMPLER_LINEAR_BORDER);

SamplerState TrilinearSampler : BUILTIN_REGISTER(BUILTIN_REGISTER_SAMPLER_TRILINEAR_WRAP);
SamplerState TrilinearClampSampler : BUILTIN_REGISTER(BUILTIN_REGISTER_SAMPLER_TRILINEAR_CLAMP);
SamplerState TrilinearBorderSampler : BUILTIN_REGISTER(BUILTIN_REGISTER_SAMPLER_TRILINEAR_BORDER);

SamplerComparisonState ShadowSampler : BUILTIN_REGISTER(BUILTIN_REGISTER_SAMPLER_SHADOW);

#define PointSampler PointClampSampler
#define LinearSampler LinearClampSampler

#if XIN_DXC
#define VK_IMAGE_FORMAT(Format) [[vk::image_format(Format)]]
#else
#define VK_IMAGE_FORMAT(Format)
#endif

#endif // _XIN_SHADER_COMMON_H_
